#ifndef REFRACTOR_H
#define REFRACTOR_H

#include "Mesh.h"

class Refractor : public Mesh
{

	public:
		Refractor();
		virtual ~Refractor();
			
		virtual void drawRefraction(const Mesh* mesh)=0;


		HRESULT createRefractionTexture2D(ID3D11Device* g_dev, const D3D11_TEXTURE2D_DESC& desc);
		HRESULT createDepthTexture2D(ID3D11Device* g_dev, const D3D11_TEXTURE2D_DESC& desc);
		HRESULT createRenderTargetView(ID3D11Device* g_dev, const D3D11_RENDER_TARGET_VIEW_DESC& rtv_desc);
		HRESULT createShaderResourceView(ID3D11Device* g_dev, const D3D11_SHADER_RESOURCE_VIEW_DESC& srv_desc);
		HRESULT createDepthStencilView(ID3D11Device* g_dev, const D3D11_DEPTH_STENCIL_VIEW_DESC& dsv_desc);

		void setRenderTarget(ID3D11DeviceContext* g_context) const;

		void passRefractionSRV(ID3DX11EffectShaderResourceVariable** fx_srv);

	private:
		ID3D11Texture2D* tex_refractions;
		ID3D11RenderTargetView* rtv_refractions;
		ID3D11ShaderResourceView* srv_refractions;

		ID3D11Texture2D* tex_refractions_depth;
		ID3D11DepthStencilView* dsv_refractions_depth;
};



#endif